<div class="common-tit">
  <h2>添加课程</h2>
  <span>课程系统 > 课程列表 > 添加课程</span>
</div>
<div class="cur-box">
  <h3>
    <em>*</em>
    <span>基本信息</span>
  </h3>
  <div class="cur-basic">
    <ul class="cb-box clearfix">
      <li class="bas-list">
        <div class="list-box spe clearfix" choice="mandatory">
          <div class="downbtn">
            <span>销售类型</span>
            <em></em>
          </div>
          <ul class="dropdown-menu">
            <li class="cho-tit">销售类型</li>
            <% CourseInfo::SALE_TYPE.each do |key,value| %>
              <li data_id="<%= key %>"><%= value %></li>
            <%end%>
          </ul>
        </div>
        <b>请选择</b>
      </li>
      <li class="bas-list">
        <div class="list-box spe clearfix" choice="mandatory">
          <div class="downbtn">
            <span>课程类型</span>
            <em></em>
          </div>
          <ul class="dropdown-menu">
            <li class="cho-tit">课程类型</li>
            <% CourseInfo::COURSE_TYPE.each do |key,value| %>
              <li data_id="<%= key %>"><%= value %></li>
            <%end%>
          </ul>
        </div>
        <b>请选择</b>
      </li>
      <li class="bas-list">
        <input type="text" class="ba-cur required" placeholder="课程名称">
      </li>
      <li class="bas-list">
        <div class="list-box spe clearfix" choice="mandatory">
          <div class="downbtn">
            <span>导师</span>
            <em></em>
          </div>
          <ul class="dropdown-menu">
            <li class="cho-tit">导师</li>
            <% @teachers.each do |teacher| %>
              <li data_id="<%= teacher.id %>"><%= "#{teacher.name}" %></li>
            <%end%>
          </ul>
        </div>
        <b>请选择</b>
      </li>
      <li class="bas-list">
        <div class="list-box spe clearfix" choice="mandatory">
          <div class="downbtn">
            <span>教室</span>
            <em></em>
          </div>
          <ul class="dropdown-menu">
            <li class="cho-tit">教室</li>
            <% @rooms.each do |room| %>
              <li data_id="<%= room.id %>"><%= "#{room.room_name}" %></li>
            <%end%>
          </ul>
        </div>
        <b>请选择</b>
      </li>
      <li class="bas-list">
        <div class="list-box spe clearfix" choice="mandatory">
          <div class="downbtn">
            <span>舞种</span>
            <em></em>
          </div>
          <ul class="dropdown-menu">
            <li class="cho-tit">舞种</li>
            <% Company::DANCE_TYPE.each do |key, value| %>
              <li data_id="<%= key %>"><%= value %></li>
            <%end%>
          </ul>
        </div>
        <b>请选择</b>
      </li>
      <li class="bas-list">
        <div class="list-box spe clearfix" choice="mandatory">
          <div class="downbtn">
            <span>授课对象</span>
            <em></em>
          </div>
          <ul class="dropdown-menu">
            <li class="cho-tit">授课对象</li>
            <% Company::AGE_GROUP.each do |key, value| %>
              <li data_id="<%= key %>"><%= value %></li>
            <%end%>
          </ul>
        </div>
        <b>请选择</b>
      </li>
      <li class="bas-list">
        <input type="text" class="ba-cur required" placeholder="课程时长" onkeyup="intNum(this)">
        <span class="bas-m">分钟</span>
      </li>
    </ul>
  </div>
  <h3>
    <span>课程设置</span>
  </h3>
  <div class="cur-setting clearfix">
    <ul class="cur-b clearfix">
      <li class="cur-con period">
        <h4>
          <i>*</i>
          <span>课时数</span>
        </h4>
        <div class="ct-box">
          <div class="ct"> <input type="text" class="ct-a" id="cho" onkeyup="intNum(this)">
            <em>课时</em>
          </div>
        </div>
      </li>
      <li class="cur-con consumption">
        <h4>
          <i>*</i>
          <span>消费方式</span>
        </h4>
        <div class="ct-box">
          <div class="ct">
            <div class="sub-con">
              <div class="test-check">
                <input type="checkbox" class="ck">
                <div class="check ct-ch">
                  <span></span>
                </div>
              </div>
            </div>
            <em>次卡</em>
            <input type="text" class="ct-i" onkeyup="intNum(this)">
            <em>次/课时</em>
          </div>
          <div class="ct">
            <div class="sub-con">
              <div class="test-check">
                <input type="checkbox" class="ck">
                <div class="check ct-ch">
                  <span></span>
                </div>
              </div>
            </div>
            <em>充值</em>
            <input type="text" class="ct-i" onkeyup="intNum(this)">
            <em>元/课时</em>
          </div>
          <div class="ct">
            <div class="sub-con">
              <div class="test-check">
                <input type="checkbox" class="ck">
                <div class="check">
                  <span></span>
                </div>
              </div>
            </div>
            <em>直接售卖</em>
          </div>
          <div class="ct card">
            <div class="sub-con">
              <div class="test-check">
                <input type="checkbox" class="ck">
                <div class="check">
                  <span></span>
                </div>
              </div>
            </div>
            <em>年卡</em>
          </div>
          <div class="ct card">
            <div class="sub-con">
              <div class="test-check">
                <input type="checkbox" class="ck">
                <div class="check">
                  <span></span>
                </div>
              </div>
            </div>
            <em>月卡</em>
          </div>
        </div>
      </li>
      <li class="cur-con">
        <h4>
          <span>是否预约</span>
        </h4>
        <div class="ct-box">
          <div class="ct order">
            <div class="sub-con">
              <div class="test-check">
                <input type="checkbox" class="ck">
                <div class="check">
                  <span></span>
                </div>
              </div>
            </div>	
            <em>需要预约</em>
            <i>学员需要预约方可上课</i>
          </div>
          <i class="private">私教必须预约才可以上课</i>
        </div>
      </li>
      <li class="cur-con duration">
        <h4>
          <i>*</i>
          <span>课程时间</span>
        </h4>
        <div class="ct-box">
          <div class="curb-box" id="weekly">
            <div class="ctc">
              <div class="sub-con">
                <div class="test-check">
                  <input type="checkbox" class="ck">
                  <div class="check">
                    <span></span>
                  </div>
                </div>
              </div>
              <em class="ctw">每周时间</em>
              <div class="date-box1">
                <input type="text" class="date-list1" readOnly="true" placeholder="年月日">
              </div>
              <b> - </b>
              <div class="date-box2">
                <input type="text" class="date-list2" readOnly="true" placeholder="年月日">
              </div>
            </div>

            <!-- <div class="ct-write">
              <strong>星期一</strong>
              <span>12</span>
              <em>时</em>
              <span>30</span>
              <em>分</em>
              <div class="comm-del">删除</div>	
              </div> -->
              <div class="ct-add">
                <div class="list-box spe clearfix" choice="mandatory">
                  <div class="downbtn">
                    <span>请选择星期数</span>
                    <em></em>
                  </div>
                  <ul class="dropdown-menu">
                    <li class="cho-tit">请选择星期数</li>
                    <% Company::WEEKTIME.each do |key,value| %>
                      <li data_id="<%= key %>"><%= value %></li>
                    <%end%>
                  </ul>
                </div>
                <b>请选择</b>
                <input type="text" class="cta-h" onkeyup="intNum(this)">
                <strong>时</strong>
                <input type="text" class="cta-m" onkeyup="intNum(this)">
                <strong>分</strong>
                <div class="comm-add">
                  <span>添加</span>
                  <div class="not-ad">请至少添加一条时间</div>
                </div>
              </div>
          </div>
          <!--  -->
          <div class="curb-box" id="oneday">
            <div class="ctc">
              <div class="sub-con">
                <div class="test-check">
                  <input type="checkbox" class="ck">
                  <div class="check">
                    <span></span>
                  </div>
                </div>
              </div>
              <em class="ctw">单天设置</em>
            </div>

            <!-- <div class="ct-write">
              <strong>2015-07-15</strong>
              <span>12</span>
              <em>时</em>
              <span>30</span>
              <em>分</em>
              <div class="comm-del">删除</div>	
              </div> -->
              <div class="ct-add ctl">
                <div class="date-ibox">
                  <input type="text" class="date-input" readOnly="true" placeholder="年月日">
                </div>
                <input type="text" class="cta-h" onkeyup="intNum(this)">
                <strong>时</strong>
                <input type="text" class="cta-m" onkeyup="intNum(this)">
                <strong>分</strong>
                <div class="comm-add">
                  <span>添加</span>
                  <div class="not-ad">请至少添加一条时间</div>
                </div>
              </div>
          </div>
        </div>
      </li>
    </ul>
    <%= tag(:input, :type => 'hidden', :name => 'utf-8',:value => "✓") %>
    <%= tag(:input, :type => "hidden", :name =>  request_forgery_protection_token.to_s, :value =>   form_authenticity_token) %> 
    <div class="preserve">保存</div>
  </div>
</div>

<script src="/assets/js/common.js"></script>
<script>
   $(function(){
     $('.date-list1').date_input();
     $(".date-list2").date_input();
     $(".date-input").date_input();
   });
   $('.date-list2').on("click", function() {
     updateT1();
     $('.nav span').on("click", function() {
       if ($(this).parent().parent().parent().prev().attr("class") == "date-list2") {
         updateT1();
       };
     });
   });
   $('.date-list1').on("click", function() {
     updateT2();
     $('.nav span').on("click", function() {
       if ($(this).parent().parent().parent().prev().attr("class") == "date-list1") {
         updateT2();
       };
     });
   });
</script>
